package com.yupi.springbootinit.mq.mqttproxy;

import org.msgpack.core.MessagePack;
import org.msgpack.value.Value;
/**
 * @Author:WwW
 * @Description
 * @Date: 2025/9/16  15:45
 */
public class MqttMsgPackDecoder {
    public static String decode(byte[] payload) {
        try {
            Value val = MessagePack.newDefaultUnpacker(payload).unpackValue();
            return val.toString();
        } catch (Exception e) {
            throw new RuntimeException("MsgPack 解码失败", e);
        }
    }
}
